import 'reflect-metadata/Reflect.js';
import Video from './Video';
import Base from './Base';
import { Type } from 'class-transformer';
export default class Playlist extends Base {
  public title = '';
  public description = 'No description';
  public coverImage?: string;
  public isBookmarked = false;
  public creatorName = '';
  public creatorId = '';
  public creatorAvatar?: string;
  public isLocked = false;
  @Type(() => Video)
  public contents: Video[] = [];
  public viewCount = 0;
  public status: PlaylistStatus = PlaylistStatus.NORMAL;
  public isPinned = false;
  public checked?: boolean;
  constructor(id: string, title: string, description: string) {
    super();
    this.id = id;
    this.title = title;
    this.description = description;
  }
  public get numContents(): number {
    return this.contents.length;
  }
}
export enum PlaylistStatus {
  UNKNOWN = 0,
  NORMAL = 1,
  UPLOADING = 2,
  VERIFING = 3,
  DISALBED = 4,
  PRIVATE = 5,
  DRAFT = 6,
  UNPUBLISHED = 7,
}
